package com.youhome.service.service.impl;


import com.youhome.service.mapper.CompanyMapper;
import com.youhome.service.model.Company;
import com.youhome.service.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by chen365 on 2018/05/22.
 */
@Service
public class CompanyServiceImpl implements CompanyService {
    @Autowired
    private CompanyMapper companyMapper;

    @Override
    public List<Company> selectAll() {
        return companyMapper.selectAll();
    }

    @Override
    public int updateByPrimaryKeySelective(Company record) {
        record.setUpdateTime(new Date());
        return companyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateMinusLimitByAppKey(String appKey) {
        return companyMapper.updateMinusLimitByAppKey(appKey);
    }

    @Override
    public int updateTokenByAppKey(Company company) {
        return companyMapper.updateTokenByAppKey(company);
    }

    @Override
    public Company selectByPrimaryKey(Long id) {
        return companyMapper.selectByPrimaryKey(id);
    }
}
